/*  var id = getvl("id");*/
useradmin();
 function useradmin(){
	$.ajax({
		url: urlcore + "/api/user/getadmin",
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			if (data.success == true) {
		       shop(data.data.id);
			}else{
			   window.location.href="gotoindex.html";	
			}
		},
		error:function() {
			/* Act on the event */
			alert("error");
		}
	});	
 }
 
 
 var shops="";
 
 function shop(id){
    	 $.ajax({
      url: urlcore + "/api/shopInfo/selectagno1?id="+id,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					shops=data.data.id;
					zhanghuxinxi();
			}
			},
			error: function() {
				alert("error");
			}
		});	
}
 
 var ss=0;
 var currentPage=1;
 function  zhanghuxinxi(){
 	     if(ss!=0 || currentPage==1 || currentPage==2){
    	 $.ajax({
      url: urlcore + "/api/goods/selectGoodsList?current="+currentPage+"&shopId="+shops+"&status=1",
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					var sun=1;
					ss=data.data.list.length;
					$.each(data.data.list, function(y,n) {	
				var shangping='<div class="clearfix tuwen sell_shangpin">'+
    	'<a href="20.3.2daikexiadan_goods_guige.html?id='+n.id+'">'+
	        '<div class="tuwen-img fl">'+
	            '<img onerror="errorImg(this)" src="'+n.coverUrl+'" width="75" height="75">'+
	        '</div>'+
	        '<div class="tuwen-wenzi">'+
	            '<h5 class="wuye_h01">'+n.goodsTitle+'</h5>'+
	            '<div class="wuye_div02">&yen;'+n.packPrice+'  -  &yen;'+n.tradePrice+'</div>'+
	        '</div>'+
        '</a>'+
    '</div>';
						$("#shangping").append(shangping);
					});
				} else if(data.code == 'OVERTIME') {
					var thisUrl = window.location.href;
					alert(thisUrl);
					if(thisUrl.indexOf('1.0.0denglu.html') <= -1) {
						top.window.location.href = "1.0.0denglu.html";
					}
				} else {
					if(data.msg != '空数据') {
						alert(data.msg)
					} else {
						$('#thiscount').text(0);
					}
				}
			},
			error: function() {
				alert("error");
			}
		});	
		}
    }

 
 
  var pageNo=1;
  function zijingguanlitixian(withdrawStatus){
  	   $("#zijingguanlitixians").html("");
	$.ajax({
		url: urlcore + "/api/cashRecord/selectCashRecordByWithdrawStatus2?current="+pageNo+"&withdrawStatus="+withdrawStatus+"&userId="+id,
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			if (data.success == true) {
				alert(JSON.stringify(data.data));
				$.each(data.data, function(y,n) {
						var gmtDatetime = new Date(n.gmtDatetime).pattern("yyyy-MM-dd hh:mm:ss");
						    var withdraw_status2="";
						    if(n.withdrawStatus==1){
						    	withdraw_status2="处理中";
						    }else if(n.withdrawStatus==2){
						    	withdraw_status2="失败";
						    }else if(n.withdrawStatus==3){
						    		withdraw_status2="已打款";
						    }
				var zijingguanlitixians='  <div class="a_bank_informs clearfix">'+
'	            <ul>'+
'	                <li><h5>'+n.money+'</h5></li>'+
'	                <li>'+n.bankName+n.bankNumber+'</li>'+
'	                <li>'+gmtDatetime+'</li>'+
'	            </ul>'+
'	            <span class="a_chuliing">'+withdraw_status2+'</span>'+
'	        </div>';
              $("#zijingguanlitixians").append(zijingguanlitixians);
				});

			} 
		},
		error:function() {
			/* Act on the event */
			alert("error");
		}
	});
  }
